// 封装操作localstorage 本地储存的方法 模块化的文件
var storage = {
  set(key, value) {
    if (value == typeof {}) {
      return localStorage.setItem(key, value);
    } else {
      localStorage.setItem(key, JSON.stringify(value));
    }
  },
  get(key) {
    return JSON.parse(localStorage.getItem(key))
  },
  remove(key) {
    localStorage.removeItem(key)
  }
}
export default storage;